/**
 * 
 */
package br.com.lazyprogrammer.worldsoccermanager.network.model;

import java.io.Serializable;
import java.util.Comparator;

/**
 * 
 * @author Limao Games <br />
 * <b>Email:</b> andreikeda@limaogames.com.br <br />
 * created on: 07/05/2014
 * @version 1.0
 * @see 
 */
public class User implements Serializable, Comparator<User> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7908858231536219775L;
	
	private boolean active, online;
	private long cash, points, registeredDate;
	private String description, id, username, key, email;
	
	public User() {
		
	}
	
	public User(String id) {
		this.id	= id;
	}

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	@Override
	public int compare(User lhs, User rhs) {
		// TODO Auto-generated method stub
		return lhs.getPoints() == rhs.getPoints() ? 0 : lhs.getPoints() < rhs.getPoints() ? -1 : 1;
	}

    public long getCash() {
		return cash;
	}
	
	public String getDescription() {
		return description;
	}
	
	public String getEmail() {
		return email;
	}
	
	public String getKey() {
		return key;
	}
	
	public String getId() {
		return id;
	}
	
	public long getPoints() {
		return points;
	}
	
	public long getRegisteredDate() {
		return registeredDate;
	}
	
	public String getUsername() {
		return username;
	}
	
	public boolean isActive() {
		return active;
	}
	
	public boolean isOnline() {
		return online;
	}

    public void setActive(int active) {
		this.active	= active == 1;
	}
	
	public void setCash(long cash) {
		this.cash	= cash;
	}
	
	public void setDescription(String description) {
		this.description	= description;
	}
	
	public void setEmail(String email) {
		this.email	= email;
	}
	
	public void setKey(String key) {
		this.key	= key;
	}
	
	public void setOnline(int online) {
		this.online	= online == 1;
	}
	
	public void setPoints(long points) {
		this.points	= points;
	}
	
	public void setRegisteredDate(long registeredDate) {
		this.registeredDate	= registeredDate;
	}
	
	public void setUsername(String username) {
		this.username	= username;
	}

}
